<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddTotalToRechargeAddress extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('recharge_address', function (Blueprint $table) {
            $table->unsignedInteger('total')->after('lower')->default(0)->comment('收款总限制');
            $table->unsignedInteger('recharge_total')->after('lower')->default(0)->comment('已收款');
            $table->unsignedInteger('recharge_number')->after('lower')->default(0)->comment('收款次数');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('recharge_address', function (Blueprint $table) {
            $table->dropColumn('total');
            $table->dropColumn('recharge_total');
            $table->dropColumn('recharge_number');
        });
    }
}
